Enables a button or locked field to be dragged with the mouse while in the browse mode. ΓÇ£DragOnΓÇ¥ displays a dotted outline of the button or field. The outline follows the mouse as it is dragged. When the mouse is released, the button or field automatically moves to the new position. Just like dragging a window!
Options include: Vertical only motion, Horizontal only motion, Author selectable boundaries beyond which the object will not move, and Author selectable boundary types: 1). Completely bound the object, 2). Bound the mid-point of the object, 3). Bound the point being dragged.
© Copyright 1988 by Mark W. Worthington
All Rights Reserved
Mark W. Worthington
27 Maple Park
Newton, MA. 02159
After August 1988:
49 Midgley Lane
Worcester, MA 01604
The XCMD “DragOn” is Copyright © Mark W. Worthington, however, anyone may use it in any HyperCard stack, whether for commercial or non-commercial distribution, so long as this notice appears in the About box (or equivalent) of the stack. However, the XCMD may not be sold in and of itself or as a package with other development tools. This does not exclude reasonable distribution charges for downloading, disks, shipping, etc. I simply do not want someone trying to sell what is free.
ΓÇóΓÇóSpecial thanks go to Mark for contributing this XCMD to the Developer Stack and allowing us to distribute it!
[Editor]
-- part contents for background part 10
----- text -----
Syntax:
(use in a mouseDown or mouseStillDown handler)
DragOn <theName>[, <theAxis>[,
<theBoundsRect>[, <theSlopRect>]]]
First parameter is mandatory, the last three are each optional. Calling "the result" IMMEDIATELY after the call to DragOn returns the new rect of the dragged object.
Parameters:
1). theName: the name of the button or field you wish to drag. Do NOT use the short name. You may simply substitute the function ΓÇ£the targetΓÇ¥ if you wish.
2). theAxis. 1= constrained to horizontal movement; 2 = constrained to vertical movement; 0, blank, empty, or anything else results in no constraint.
3). theBoundsRect. Constrains the area over which the object may be dragged. If specified, you MUST pass this in as a rectangle. The default is the entire card inset by two pixels.
Valid:
DragOn the Target,,"20,10,50,60"
Valid:
put "20,10,50,60" into zonk
DragOn the Target,, zonk
Invalid:
DragOn the Target,,20,10,50,60
4). theSlopRect. This is either an integer or a rectangle and defines the mode of theBoundsRect.